package com.zy.baselib.tools;

import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.ObservableTransformer;
import io.reactivex.rxjava3.schedulers.Schedulers;

public class RxUtils {
    private RxUtils() {
    }

    private final static ObservableTransformer schedulersTransformer =
            (ObservableTransformer<Object, Object>) upstream ->
                    upstream.subscribeOn(Schedulers.io())
                            .observeOn(AndroidSchedulers.mainThread());

    public static <T> ObservableTransformer<T, T> applySchedulers() {
        return schedulersTransformer;
    }
}
